package com.hangxintong.common.feign;

import com.hangxintong.common.base.dto.LmPcWebFormInsertRecordDTO;
import com.hangxintong.common.base.dto.LmPcWebFormRecordDTO;
import com.hangxintong.common.base.vo.LmPcWebFormVO;
import com.hangxintong.common.config.FeignConfiguration;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.List;
import com.hangxintong.common.utils.Result;
/**
 * @Auther: tsj
 * @Date: 2020/12/30 14:44
 * @Description:
 */
@FeignClient(value = "coalition",configuration = FeignConfiguration.class)
public interface FormFegin {



    @GetMapping("/openFegin/member/getForm/{formId}")
    LmPcWebFormVO getForm(@PathVariable("formId") String formId);


    /**
     * 插入表单记录信息
     */
    @PostMapping("/openFegin/member/insert")
    Result insertFormData(@RequestBody List<LmPcWebFormRecordDTO> list);


    @PostMapping("/openFegin/member/getRecord")
    Result getRecord(@RequestParam String id, @RequestParam(required = false,defaultValue = "0")Integer type);


    @GetMapping("/openFegin/member/getFormInfo")
    @ApiOperation("获取表单元素")
    Result getFormInfo(@RequestParam String formId);

    /**
     * 插入表单记录信息
     */
    @PostMapping("/openFegin/member/insertFormRecord")
    @ApiOperation("插入表单记录")
    Result insertFormData(@RequestBody LmPcWebFormInsertRecordDTO dto);


    /**
     * 修改表单记录项为可修改或不可修改
     * @param recordId
     * @param flag
     * @return
     */
    @PatchMapping("/openFegin/member/updateFormDataIsModifyByRecordId")
    Result updateFormDataIsModifyByRecordId(@RequestParam String recordId,
                                            @RequestParam(required = false,defaultValue = "0") Integer flag);

    /**
     * 通过表单填写记录id查询表单填写具体内容
     */
    @GetMapping("/openFegin/member/getFormDataByRecordIdList")
    @ApiOperation(value = "获取表单填写记录信息",notes = "获取表单填写记录信息",produces = "tsj")
    Result getFormDataByRecordIdList(@RequestParam String recordId);
}
